package mixins

import (
	"gitlab.zhijiasoft.com/paperless-group/saas-common/utils/sonyflake"

	"entgo.io/ent"
	"entgo.io/ent/schema/field"
	"entgo.io/ent/schema/mixin"
)

type SonyflakeMixin struct {
	mixin.Schema
}

func (SonyflakeMixin) Fields() []ent.Field {
	return []ent.Field{
		field.String("id").
			DefaultFunc(sonyflake.GetStringFlake).
			Unique().
			Comment("id"),
	}
}
